package com.topnav.mc.lock;

import com.js.lib.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 测试
 */
@Component
@Slf4j
public class TestJob {

    @SyncLock(key="THIS-IS-A-TEST-SYNCLOCK",dueSec = 180)
    public void execute(){
        log.info("TestJob运行：{}", DateUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
        try {
            Thread.sleep(6000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}
